//
//  MyTools.h
//  PersonalOC
//
//  Created by 韩琴 on 2018/8/21.
//  Copyright © 2018年 韩琴. All rights reserved.
//

#import "LYTools.h"
#include <UMSocialCore/UMSocialCore.h>
#include <UShareUI/UShareUI.h>

@interface MyTools : LYTools
/**
 谁作为window的rootvc vc:根控制器  isHaveNavBar：是否有navbar
 */
//变更更目录
+ (void)changeRootVc:(UIViewController *)vc and:(BOOL)isHaveNavBar;
/**
 GET请求
 
 @param url 接口地址
 @param dict 参数
 @param scrollView 列表或者滚动视图
 @param view 菊花所在view
 @param success 成功回调
 @param failure 失败回调
 */
+ (void)GetNetworkWithUrl:(NSString *)url withDict:(NSDictionary *)dict withScrollView:(UIScrollView *)scrollView withInView:(UIView *)view success:(PPHttpRequestSuccess)success
                  failure:(PPHttpRequestFailed)failure;
/**
 POST请求
 
 @param url 接口地址
 @param dict 参数
 @param scrollView 列表或者滚动视图
 @param view 菊花所在view
 @param success 成功回调
 @param failure 失败回调
 */
+ (void)PostNetworkWithUrl:(NSString *)url withDict:(NSDictionary *)dict withScrollView:(UIScrollView *)scrollView withInView:(UIView *)view success:(PPHttpRequestSuccess)success
                   failure:(PPHttpRequestFailed)failure;
/**
 上传多个图片
 
 @param url 接口
 @param dict 参数
 @param fileArr 传到服务端的参数名(不是文件名)
 @param imgArr 图片数组
 @param view 展示菊花的view
 @param success 成功
 @param failure 失败
 */
+ (void)uploadMoreImageWithURL:(NSString *)url withDict:(NSDictionary *)dict withFileArr:(NSArray *)fileArr withImageArr:(NSArray *)imgArr  withInView:(UIView *)view success:(PPHttpRequestSuccess)success   failure:(PPHttpRequestFailed)failure;
/**
 上传文件
 
 @param url url地址
 @param dict 参数
 @param view 展示菊花的view 不传就是window
 @param name 对应在服务器上面的名字
 @param filePath 文件路径
 @param success 成功
 @param failure 失败
 */
+ (void)UploadNetworkWithUrl:(NSString *)url withDict:(NSDictionary *)dict  withInView:(UIView *)view withFileName:(NSString *)name withFilePath:(NSString *)filePath success:(PPHttpRequestSuccess)success
                     failure:(PPHttpRequestFailed)failure;


#pragma mark——————————支付宝
/*
 orderString : 后台返回的密钥串
 successBlock: 成功回调
 wrongBlock  : 失败回调
 */
typedef void (^payBlock)(void);

+ (void)aliPay:(NSString *)orderString withSuccessResult:(payBlock)successBlock withWrongResult:(payBlock)wrongBlock;

#pragma mark——————————————————微信支付
+ (void)wechtPay_partnerId:(NSString *)partnerId prepayId:(NSString *)prepayId package:(NSString *)package nonceStr:(NSString *)nonceStr timeStamp:(UInt32 )timeStamp sign:(NSString *)sign appid:(NSString *)appid;

#pragma mark——————————————————第三方登录
+ (void)UMLogin:(UMSocialPlatformType)platformType withOpenIDBlock:(void(^)(UMSocialUserInfoResponse *value)) block;

#pragma mark————————————————————友盟分享
/**
 *  友盟分享
 *
 *  @param shareUrl 分享链接地址(点击)
 *  @param vc       当前vc
 *  @param title    标题
 *  @param image    分享图片
 *  @param Source   描述
 */
+ (void)UMShareWithShareUrl:(NSString *)shareUrl  withViewController:(UIViewController *)vc  withTitle:(NSString *)title  withImage:(UIImage *)image withSource:(NSString *)Source;
@end
